﻿using System.Web;
using ORM.Business.Models;
using ORM.Business.Models.Caching;

namespace ORM.Framework.Security
{
    public static class SecurityHelper
    {
        /// <summary>
        /// Gets current PermissionBasedPrincipal
        /// </summary>
        public static IPermissionBasedPrincipal CurrentUser
        {
            get { return HttpContext.Current.User as IPermissionBasedPrincipal; }
        }

        public static bool CanEditContentsDirectly()
        {
            return CurrentUser.HasPermission(KeyObject.Permission.EditContents);
        }
    }
}